using System.Management.Automation;

namespace PoshRabbit
{
    [Cmdlet(VerbsLifecycle.Stop, "RabbitConsumer")]
    public class StopConsumerCmdlet : Cmdlet
    {
        [Parameter(ValueFromPipeline = true, Mandatory = true)]
        public IRabbitConsumer Consumer { get; set; }

        RabbitConsumer RabbitConsumer
        {
            get { return (RabbitConsumer)Consumer; }
        }

        protected override void ProcessRecord()
        {
            RabbitConsumer.Stop();
        }
    }
}